home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_watersplash.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  119 lines

  1. # Jones 3D Cog Script
  2. #
  3. # GEN_WaterSplash.cog
  4. #
  5. # Attach to a ghost object.
  6. #
  7. # [TRM]
  8. #
  9. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14.     message     startup
  15.     #message     sighted
  16.     message     timer
  17.     
  18.     thing       origin          # Where the bubbles are coming from
  19.     thing       wave            local
  20.     thing       player          local
  21.     
  22.     template    splash0=+ripples2     local
  23.     template    splash1=+ripples      local
  24.     template    splash2=+ripples      local
  25.     
  26.     #template    splash0=+bubbles2       local
  27.     #template    splash1=+bubbles2       local
  28.     #template    splash2=+bubbles2       local
  29.     
  30.     vector      vecPos          local
  31.     vector      startWave       local
  32.     vector      finWave         local
  33.     
  34.     int         i=0             local
  35.     int            waves=5            local
  36.     int         randNum         local
  37.     int         waves_On=0      local
  38.     
  39.     flex        fin_XY          local
  40.     
  41. end
  42.  
  43. # ========================================================================================
  44.  
  45. code
  46.  
  47. startup:
  48.  
  49.     SetTimer(0.5);
  50.  
  51.     #AnimateSpriteSize(origin, '2.0 3.0 0.0', '3.0 4.0 0.0', 10.1);
  52.     
  53.     return;
  54.  
  55. # ========================================================================================
  56.  
  57. #sighted:
  58.  
  59. #    player = GetLocalPlayerThing();
  60.     
  61. #    Sleep(0.01);
  62.     
  63. #    Print("sighted");
  64.     
  65. #    if((HasLOS(player, origin)) && (waves_On == 0))
  66. #    {
  67. #        #Sleep(Rand() + RandBetween(1, 3));
  68. #        waves_On = 1;
  69. #        SetTimer(0.5);
  70. #    }
  71.     
  72.    # return;
  73.  
  74. # ========================================================================================
  75.  
  76. timer:
  77.  
  78.     vecPos = VectorSet(rand()*0.15, rand()*0.15, 0);
  79.     
  80.     randNum = RandBetween(1, 3);
  81.     
  82.     if(randNum == 1) fin_XY = 0.1;
  83.     
  84.     else if(randNum == 2) fin_XY = 0.3;
  85.     
  86.     else if(randNum == 3) fin_XY = -0.05;
  87.     
  88.     for(i=0; i<waves; i=i+1)                                                                        
  89.     {                                                                                                    
  90.         #PrintInt(i);
  91.         wave = CreateThingAtPos(splash0[RandBetween(0, 2)], GetThingSector(origin), VectorAdd(GetThingPos(origin), VectorAdd('-0.025 -0.035 0.0', vecPos)), '0 0 0');
  92.         CaptureThing(wave);
  93.         
  94.         startWave = VectorSet(0.01, 0.01, 1.0);
  95.         finWave = VectorSet(0.15+fin_XY, 0.15+fin_XY, 0.0);
  96.         AnimateSpriteSize(wave, startWave, finWave, 1.3);
  97.         #ThingFadeAnim(wave, 1.0, 0.5, 1.0, 0);
  98.     }
  99.     
  100.     #if(HasLOS(player, origin))
  101.     #{
  102.     #    waves_On = 0;
  103.         SetTimer(0.5);
  104.     #}
  105.     
  106.     #if(!HasLOS(player, origin))
  107.     #{
  108.     #    Print("no LOS");
  109.     #    waves_On = 0;
  110.     #    ClearThingFlags(origin, 0x100000);  # mark thing as unseen
  111.     #}
  112.     
  113.     return;   
  114.     
  115. # ========================================================================================
  116.  
  117. end
  118.  
  119.